home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Deutsche Edition 1
/
Deutsche Edition 1.iso
/
bavarian
/
011-020
/
014_anwendungen_3
/
3 malprogramme
/
sketch master
(
.txt
)
< prev
next >
Wrap
AmigaBASIC Source Code
|
1993-11-04
|
2KB
|
118 lines
start:
SCREEN 1,320,200,4,1
WINDOW 2,"sketch master",(0,0)-(311,185),12,1
clr=1
CLS
MENU 1,0,1,"tools"
MENU 1,1,1,"point"
MENU 1,2,1,"line"
MENU 1,3,1,"box"
MENU 1,4,1,"circle"
MENU 1,5,1,"paint"
MENU 1,6,1,"triangle"
MENU 1,7,1,"clear "
MENU 1,8,1,"stop"
MENU 2,0,1,"colors"
MENU 2,1,1,"blue"
MENU 2,2,1,"white"
MENU 2,3,1,"black"
MENU 2,4,1,"orange"
MENU 2,5,1,"dk blue"
MENU 2,6,1,"violet"
MENU 2,7,1,"aqua"
MENU 2,8,1,"grey"
MENU 3,0,1,"colors"
MENU 3,1,1,"brown"
MENU 3,2,1,"red"
MENU 3,3,1,"lime"
MENU 3,4,1,"yellow"
MENU 3,5,1,"skyblue"
MENU 3,6,1,"purple"
MENU 3,7,1,"green"
MENU 3,8,1,"dk grey"
MENU ON
ON MENU GOSUB settool
REM mouse control
loop: f=MOUSE(0)
IF f=-1 THEN temp
IF f=0 THEN loop
IF f=1 THEN draw
GOTO loop
temp: IF ch=7 THEN temp
x1=MOUSE(3) :y1=MOUSE(4)
x2=MOUSE(5) : y2=MOUSE(6)
ON ch GOSUB tpt,tln,tbx,tcr,pnt,ttri
GOTO loop
draw: IF ch=7 THEN temp
x1=MOUSE(3) : y1=MOUSE(4)
x2=MOUSE(5) : y2=MOUSE(6)
ON ch GOSUB tpt,ln,bx,cr,pnt,tri
GOTO loop
tpt: PSET (x1,y1),clr
z=MOUSE(0) : IF z>0 THEN RETURN
x1=MOUSE(1) : y1=MOUSE(2)
GOTO tpt
tln: LINE (x1,y1)-(x2,y2),clr
LINE (x1,y1)-(x2,y2),0
RETURN
ln: LINE (x1,y1)-(x2,y2),clr
RETURN
tbx: LINE (x1,y1)-(x2,y2),clr,b
LINE (x1,y1)-(x2,y2),0,b
RETURN
bx: LINE (x1,y1)-(x2,y2),clr,b
RETURN
tcr: IF ABS(x1-x2)<11 THEN RETURN
CIRCLE (x1,y1),x2-x1,clr,,,0.88
CIRCLE (x1,y1),x2-x1,0,,,0.88
RETURN
cr: IF ABS(x1-x2)<11 THEN RETURN
CIRCLE (x1,y1),x2-x1,clr,,,0.88
RETURN
pnt: PAINT (x1,y1),clr,clr
RETURN
ttri: LINE (x1,y1)-(x2,y2),clr
LINE (x2,y2)-STEP (40,40),clr : LINE -(x1,y1),clr
LINE (x1,y1)-(x2,y2),0
LINE (x2,y2)-STEP (40,40),0 : LINE -(x1,y1),0
RETURN
tri: LINE (x1,y1)-(x2,y2),clr
LINE (x2,y2)-STEP (40,40),clr : LINE -(x1,y1),clr
RETURN
scn: CLS : RETURN
settool: mn=MENU(0)
ON mn GOSUB tools,c1,c2
RETURN
tools: ch=MENU(1)
IF ch=7 THEN GOSUB scn
IF ch=8 THEN fini
RETURN
c1: clr=MENU(1)-1
RETURN
c2: clr=MENU(1)+7
RETURN
fini: MENU RESET : CLS : STOP